﻿import QtQuick
import QtQuick.Controls.impl
import QtQuick.Templates as T
import FilUI

T.ToolTip {
    id: control

    x                                           : parent ? (parent.width - implicitWidth) / 2 : 0
    y                                           : -implicitHeight - 3
    implicitWidth                               : Math.max(implicitBackgroundWidth + leftInset + rightInset,
                                                           contentWidth + leftPadding + rightPadding)
    implicitHeight                              : Math.max(implicitBackgroundHeight + topInset + bottomInset,
                                                           contentHeight + topPadding + bottomPadding)
    margins                                     : 6
    padding                                     : 6
    font                                        : FilTextStyle.Body
    closePolicy                                 : T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
    contentItem                                 : FilText {
        text                                    : control.text
        font                                    : control.font
        wrapMode                                : Text.Wrap
    }
    background                                  : Rectangle {
        color                                   : Qt.rgba(1, 1, 1, 1)
        radius                                  : 3
        FilShadow {
            radius                              : 3
        }
    }
}
